package com.su.test;

/**
 * @author Li
 * @Date 2023/4/7 16:08
 */
public class TwoArray {
    public static void main(String[] args) {
        /**
         * 二维数组遍历，求和
         */
        int sum=0;
        int[][] array = {{1, 2},{2,3},{3,4}};
        for (int i=0;i<array.length;i++){

            for (int j = 0;j<array[i].length;j++){
                sum+=array[i][j];
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
        System.out.println("数组和:"+sum);
    }
}
